package com.example.community;

import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

@SpringBootTest
public class testDF {
    @Test
    public void test(){
        SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");

        Calendar calendar = Calendar.getInstance();
        Date date = new Date();
        System.out.println(df.format(date));
        calendar.setTime(new Date());
        System.out.println(calendar.getTime());
        System.out.println(df.format(calendar.getTime()));
    }
}
